
class Student{
    private String name;
    private int age;
    //加了static就不属于成员对象了
    //classRoom 被放在了 方法区
    public static String classRoom = "107";

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }
    public void doClass(){
        System.out.println("上课！");
    }

}


public class Test2 {
    public static void main(String[] args) {
    Student s = new Student();
    //调用static 修饰的时候，用类调用就可以了
        System.out.println(Student.classRoom);
    }
}
